package com.gome.ZooKeeper;

import java.util.Arrays;

public class TestZoo {
	
	public static void main(String[] args) {
		try {
			ZooKeeperOperator zkoperator = new ZooKeeperOperator();
			zkoperator.connect("127.0.0.1");
			byte[] data = new byte[]{'d','a','t','a'};
			
			zkoperator.create("/root",null);
			System.out.println(Arrays.toString(zkoperator.getData("/root")));
			
			zkoperator.create("/root/child1",data);
			System.out.println(Arrays.toString(zkoperator.getData("/root/child1")));
			
			zkoperator.create("/root/child2",data);
			System.out.println(Arrays.toString(zkoperator.getData("/root/child2")));
			
			System.out.println("节点孩子信息:");
			zkoperator.getChild("/root");
			
			zkoperator.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}


}
